{% extends 'common/panel.html' %}
{% block title %}{{instance.name}}{% endblock title %}
{% block panel %}
    <h1>{{instance.name}}</h1>
    <div class="tabs">
        <ul>
            <li><a href="#Attributes"><span>Information</span></a></li>
            <li><a href="{% url group-impacts instance.pk %}"><span>Cumulative Impacts</span></a></li>
        </ul>
        <div id="Attributes">
            <ul class="metadata">
              {% if instance.user.first_name and instance.user.last_name %} 
                <li class="creator">Created By {{instance.user.first_name}} {{instance.user.last_name}}</li>
              {% else %}
                <li class="creator">Created By {{instance.user.username}}</li>
              {% endif %}
                <li class="created">Created {{instance.date_created|date:"d M, Y P"}}</li>
                <li class="modified">Modified {{instance.date_modified|date:"d M, Y P"}}</li>
                <li class="created">Group ID {{instance.pk}}</li>
                <br class="clear" />
            </ul>
            <h2>Description</h2>
            {% if instance.description %}
            <p>{{instance.description}}</p>
            {% else %}
            <p><em>None specified.</em></p>
            {% endif %}
            <h2>Summary of Zones by Designation</h2>

            {% with instance.summary_by_designation as desig_dict %}
            <table class="hab_repr_container">
                <tr>
                    <th>Designation Type</th>
                    <th># of Zones</th>
                    <th>Area (mi<sup>2</sup>)</th>
                    <th>Percent of Study Region</th>
                </tr>
                {% for sort,desig in desig_dict.items  %}
                <tr class="{% cycle '' 'grey' %}">
                    <td>{{desig.designation|default:"Undesignated"}}</td>
                    <td>{{desig.count}}</td>
                    <td>{{desig.area|floatformat:"-1"}}</td>
                    <td>{{desig.percent_of_sr|floatformat:"-2"}}%</td>
                </tr>
                {% endfor %}
            </table>
            {% endwith %}


            {% if instance.supportfile1 or instance.supportfile2 %}
                <h2>Supporting Files</h2>
                <ul>
                    {% if instance.supportfile1 %} <li><p><a href="{% url array-download instance.pk,1 %}">{{instance.supportfile1_shortname}}</a></p></li> {% endif %}
                    {% if instance.supportfile2 %} <li><p><a href="{% url array-download instance.pk,2 %}">{{instance.supportfile2_shortname}}</a></p></li> {% endif %}
                </ul>
            {% endif %}
		</div>
		
        <div id="Impacts" class="tabs">
        </div>
        
    </div>
{% endblock panel %}
